﻿using System;
using System.Windows.Forms;
using System.Windows.Input;
using ff14bot.Helpers;
using Newtonsoft.Json;
using System.IO;
using System.Configuration;
using System.ComponentModel;

namespace Magitek.Settings

{
    public partial class MagitekSettings : JsonSettings
    {
        
        private static MagitekSettings _instance;
        public static MagitekSettings Instance { get { return _instance ?? (_instance = new MagitekSettings("MagitekSettings")); } }
        public MagitekSettings(string filename): base(Path.Combine(CharacterSettingsDirectory, filename + ".json")) { }

        #region General
        public BindingList<String> _dispeList = new BindingList<string>();
        public BindingList<String> _dontaoeList = new BindingList<string>();
        public BindingList<String> _interruptList = new BindingList<string>();
        public BindingList<String> _pvpCCbreakList = new BindingList<string>();

        #region AOE Hotkey
        [Setting, DefaultValue(Keys.Z)]
        public Keys AOEKeyChoice { get; set; }

        [Setting, DefaultValue(ModifierKeys.Shift)]
        public ModifierKeys AOEModKeyChoice { get; set; }

        [Setting, DefaultValue(false)]

        public bool AOEEnabled { get; set; }
        #endregion

        [Setting, DefaultValue(false)]
        public bool PetFollow { get; set; }

        [Setting, DefaultValue("Lava Toad Legs")]
        public string foodname { get; set; }

        [Setting, DefaultValue(true)]
        public bool DoPVP { get; set; }

        [Setting, DefaultValue(true)]
        public bool usefood { get; set; } 

        [Setting, DefaultValue(false)]
        public bool acceptraise { get; set; }

        [Setting]
        public string lastspellused { get; set; }

        [Setting, DefaultValue(30)]
        [Browsable(false)]
        public int PulsesPerSecond { get; set; }

        [Setting, DefaultValue(1)]
        public int HealDoubleCastingTimer { get; set; }

        [Setting, DefaultValue(3)]
        [Browsable(false)]
        public int TargetsToAOEHeal { get; set; }

        [Setting, DefaultValue(3)]
        [Browsable(false)]
        public int TargetsToAOE { get; set; }

        [Setting, DefaultValue(false)]
        public bool SummonChocobo { get; set; }

        [Setting, DefaultValue(40)]
        public int RestHealth { get; set; }

        [Setting, DefaultValue(40)]
        public int RestEnergy { get; set; }

        [Setting, DefaultValue(false)]
        public bool AlwaysOnTop { get; set; }

        [Browsable(false)]

        public virtual float RestEnergyDone
        {
            get
            {
                if (RestEnergy * 2 < 100)
                    return RestEnergy * 2;
                return 100f;
            }
        }
        [Browsable(false)]
        public virtual float RestHealthDone
        {
            get
            {
                if (RestHealth * 2 < 100)
                    return RestHealth * 2;
                return 100f;
            }
        }

        [Setting, DefaultValue(false)]
        public bool SoloMode { get; set; }

        [Setting, DefaultValue(false)]
        public bool HealEveryone { get; set; }

        [Setting, DefaultValue(true)]
        public bool InterruptCast { get; set; }

        #endregion
        #region PVP
        [Setting, DefaultValue(20)]
        public int pvpAttunementHpPercent { get; set; }

        [Setting, DefaultValue(70)]
        public int pvpManaDrawMpPercent { get; set; }

        [Setting, DefaultValue(2)]
        public int pvpEnemiesToAOE { get; set; }

        [Setting, DefaultValue(30)]
        public int pvpTetsudoHpPercent { get; set; }

        [Setting, DefaultValue(true)]
        public bool pvpPurify { get; set; }

        [Setting, DefaultValue(true)]
        public bool pvpFarshot { get; set; }

        [Setting, DefaultValue(true)]
        public bool pvpFetterWard { get; set; }

        [Setting, DefaultValue(true)]
        public bool pvpAttunement { get; set; }

        [Setting, DefaultValue(true)]
        public bool pvpManaDraw { get; set; }

        [Setting, DefaultValue(true)]
        public bool pvpEquanimity { get; set; }

        [Setting, DefaultValue(true)]
        public bool pvpFocalization { get; set; }

        [Setting, DefaultValue(true)]
        public bool pvpDivineBreath { get; set; }

        [Setting, DefaultValue(true)]
        public bool pvpSacredPrism { get; set; }

        [Setting, DefaultValue(true)]
        public bool pvpTetsudo { get; set; }

        [Setting, DefaultValue(true)]
        public bool pvpNightWing { get; set; }

        [Setting, DefaultValue(true)]
        public bool pvpPhantomDart { get; set; }
        [Setting, DefaultValue(true)]
        public bool pvpThrillOfWar { get; set; }

        [Setting, DefaultValue(true)]
        public bool pvpWeaponThrow { get; set; }

        [Setting, DefaultValue(true)]
        public bool pvpAethericBurst { get; set; }

        [Setting, DefaultValue(true)]
        public bool pvpAuraBlast { get; set; }

        [Setting, DefaultValue(true)]
        public bool pvpImpulseRush { get; set; }

        [Setting, DefaultValue(true)]
        public bool pvpMythrilTempest { get; set; }

        [Setting, DefaultValue(true)]
        public bool pvpMistyVeil { get; set; }

        [Setting, DefaultValue(true)]
        public bool pvpBlastShot { get; set; }

        [Setting, DefaultValue(true)]
        public bool pvpManaSong { get; set; }

        [Setting, DefaultValue(true)]
        public bool pvpAxeKick { get; set; }

        [Setting, DefaultValue(true)]
        public bool pvpGlorySlash { get; set; }

        [Setting, DefaultValue(true)]
        public bool pvpFullSwing { get; set; }

        [Setting, DefaultValue(true)]
        public bool pvpSomersault { get; set; }

        [Setting, DefaultValue(true)]
        public bool pvpSkewer { get; set; }

        [Setting, DefaultValue(true)]
        public bool pvpEnliven { get; set; }

        [Setting, DefaultValue(true)]
        public bool pvpWither { get; set; }
        #endregion
        #region Targetting
        [Setting, DefaultValue(false)]
        public bool AutoTarget { get; set; }

        [Setting, DefaultValue(false)]
        public bool TargetStartCombat { get; set; }

        [Setting, DefaultValue(20)]
        public int TargetDistance { get; set; }

        [Setting, DefaultValue(false)]
        public bool TargetFateEnemies { get; set; }

        [Setting, DefaultValue(false)]
        public bool TargetLowestHealth { get; set; }

        [Setting, DefaultValue(true)]
        public bool TargetAssistTank { get; set; }

        [Setting, DefaultValue(true)]
        public bool TargetAssistDPS { get; set; }

        [Setting, DefaultValue(false)]
        public bool TargetClosestEnemy { get; set; }

        #endregion
        #region Healing
        [Setting, DefaultValue(30)]
        public int HealingDispelAboveHp { get; set; }

        [Setting, DefaultValue(false)]
        public bool ToggleClericStance { get; set; }

        [Setting]
        public int HealingDispelTankAboveHp { get; set; }
        #endregion
    }
}
